<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      loadingImg: true
    };
  },
  mounted() {
    let that = this;
    let corpId = "";
    dd.ready(function() {
      // ding66011e364a5ee19c35c2f4657eb6378f
      // dingd529d79192dbdf2535c2f4657eb6378f
      // dd.ready参数为回调函数，在环境准备就绪时触发，jsapi的调用需要保证在该回调函数触发后调用，否则无效。
      that.$get("get_crop_id").then(res => {
        if (res.success) {
          corpId = res.data.corpId;
          console.log(corpId);
          dd.runtime.permission.requestAuthCode({
            corpId: corpId,
            onSuccess: function(result) {
              console.log(result.code);
              let params = {
                code: result.code
              };
              that.$get("login", params).then(res => {
                console.log("登陆成功");
                that.$get("getUserInfo").then(res => {
                  if (res.success) {
                    let menuList = JSON.stringify(res.data);
                    localStorage.setItem("menuList", menuList);
                    console.log("获取权限列表成功");
                    that.$router.push({ path: "/Homepages" });
                  } else {
                    that.$alert("获取权限失败，请刷新页面重试", "提示", {
                      confirmButtonText: "确定",
                      type: "warning"
                    });
                    return;
                  }
                });
              });
              /*{
                  code: 'hYLK98jkf0m' //string authCode
              }*/
            },
            onFail: function(err) {}
          });
        }
      });
    });
    // that.$get("getUserInfo").then(res => {
    //   if (res.success) {
    //     let menuList = JSON.stringify(res.data);
    //     localStorage.setItem("menuList", menuList);
    //     console.log("获取权限列表成功");
    //     that.$router.push({ path: "/Homepages" });
    //   }
    // });
  }
};
</script>
<style lang="less">
.el-tooltip__popper {
  max-width: 800px;
}
.lunbo-size .el-upload-list--picture-card .el-upload-list__item{
  width: 32.5%;
  height: 30vh;
}
.lunbo-size .el-upload{
  display: block;
}
.el-upload-list__item {
  transition: none !important;
}
.study-center-box {
  position: relative;
  margin-top: 4px;
  height: 100%;
  overflow: auto;
}
.el-button--primary,
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: rgb(71, 135, 227);
}
.el-button--primary {
  background-color: #4787e4 !important;
}
.face-class .el-input__inner,
.small-class .el-input__inner,
.teacher .el-input__inner,
.class-finish .el-input__inner {
  width: 193px !important;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
.el-form--inline .el-form-item {
  margin-right: 35px;
}
.init-label .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.el-form-item__error {
  padding-top: 0 !important;
}
.el-textarea__inner {
  height: 100%;
}
.zZindex,
.el-message {
  z-index: 99999 !important;
}
.el-dialog__body {
  padding: 0;
}
.el-table__fixed-right-patch {
  top: 0;
  background-color: #4787e3;
}
::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(153, 153, 153, 0.5) !important;
  border-radius: 3px !important;
}
.el-tabs__item.is-active,
.el-button--text,
.underline {
  color: #4787e4 !important;
}
.el-tabs__item,
.el-form-item__label,
.el-button--small,
.el-button--text,
.strong th > .cell,
.el-table th > .cell {
  font-size: 16px !important;
}

#app {
  font-family: "微软雅黑 Regular";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* height: 100vh; */
  overflow: hidden;
  /* border: 1px solid transparent; */
  box-sizing: border-box;
}
th > .cell {
  font-weight: 700;
}
// .cell {
//   font-size: 16px;
// }
.el-table td div {
  color: rgba(0, 0, 0, 0.5);
  font-weight: 400;
  font-size: 16px;
}
.greyRow {
  background-color: #f7f7f7 !important;
  border-bottom: 13px solid #fff;
}
.el-table td,
.el-table th.is-leaf {
  border-bottom: 13px solid #fff;
}
.el-table__fixed-right-patch {
  height: 48px !important;
}
.el-tabs__nav {
  padding: 5px 0;
}
.login-info-box {
  top: 13px !important;
}
.el-input-group__append {
  padding: 0 5px;
}
.class-time-line .el-input__inner {
  width: 160px !important;
}
.class-time-lines .el-input__inner {
  width: 175px !important;
}
// .el-tabs__header{
//   margin-left: -10px;
//   margin-right: -10px;
// }
// .el-tabs__nav-wrap{
//   padding: 0 27px;
// }
</style>
